package com.svse.designPattern.structure.adapter.adapter;

import com.svse.designPattern.structure.adapter.service.TwoWayAdaptee;
import com.svse.designPattern.structure.adapter.service.TwoWayTarget;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Copyright 上海危网信息科技有限公司版权所有
 * @company wwsoft
 * @Date 2020/7/31 9:35
 */
public class TwoWayAdapter implements TwoWayTarget, TwoWayAdaptee {
    private TwoWayTarget target;
    private TwoWayAdaptee adaptee;
    public TwoWayAdapter(TwoWayTarget target)
    {
        this.target=target;
    }
    public TwoWayAdapter(TwoWayAdaptee adaptee)
    {
        this.adaptee=adaptee;
    }
    @Override
    public void request()
    {
        adaptee.specificRequest();
    }
    @Override
    public void specificRequest()
    {
        target.request();
    }
}
